import 'package:flutter/cupertino.dart';

/// 全局配置
class AppGlabol {
  static double width = 0; //屏幕宽度
  static double height = 0; //屏幕高度
  static double scale = 1.0; //比例

  static String httpProxy = '192.168.1.6:8888';
  static String channel = '';
  static bool isLogin = false; //是否登录

  static final GlobalKey<NavigatorState> navigatorKey =
      GlobalKey<NavigatorState>();

  //全局的GlobalKey
  static final GlobalKey globalKey = GlobalKey();

  /// 获取屏幕尺寸等信息
  static Future<void> initScreenSize(context) async {
    Future.microtask(() {
      final width = MediaQuery.of(context).size.width;
      final height = MediaQuery.of(context).size.height;
      AppGlabol.scale = width / 375;
      AppGlabol.width = width;
      AppGlabol.height = height;
    });
  }
}
